package com.bifang.core.dao.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 定时器日志
 *
 * @author chenzh
 * @since 2020-09-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("QRTZ_TRIGGERS_LOG")
@ApiModel(value = "QrtzTriggersLog对象", description = "定时器日志")
// @KeySequence(value = "SQ_TRIGGERS_LOG_ID", clazz = Long.class)
public class QrtzTriggersLog extends Model<QrtzTriggersLog> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "任务日志主键")
    @TableId(value = "TRIGGERS_LOG_ID", type = IdType.AUTO)
    private Long triggersLogId;

    @ApiModelProperty(value = "调度名称")
    @TableField("SCHED_NAME")
    private String schedName;

    @ApiModelProperty(value = "触发器的名字")
    @TableField("TRIGGER_NAME")
    private String triggerName;

    @ApiModelProperty(value = "触发器所属组的名字")
    @TableField("TRIGGER_GROUP")
    private String triggerGroup;

    @ApiModelProperty(value = "任务名字")
    @TableField("JOB_NAME")
    private String jobName;

    @ApiModelProperty(value = "任务所属组名字")
    @TableField("JOB_GROUP")
    private String jobGroup;

    @ApiModelProperty(value = "触发器描述")
    @TableField("DESCRIPTION")
    private String description;

    @ApiModelProperty(value = "优先级")
    @TableField("PRIORITY")
    private Long priority;

    @ApiModelProperty(value = "触发器的类型，使用cron表达式")
    @TableField("TRIGGER_TYPE")
    private String triggerType;

    @ApiModelProperty(value = "开始时间")
    @TableField("START_TIME")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    @TableField("END_TIME")
    private Date endTime;

    @ApiModelProperty(value = "日程表名称，表qrtz_calendars的calendar_name字段外键")
    @TableField("CALENDAR_NAME")
    private String calendarName;

    @ApiModelProperty(value = "措施或者是补偿执行的策略")
    @TableField("MISFIRE_INSTR")
    private Integer misfireInstr;

    @ApiModelProperty(value = "执行状态 0 执行中 1 成功 -1 失败")
    @TableField("EX_FLAG")
    private Integer exFlag;

    @ApiModelProperty(value = "信息描述")
    @TableField("MSG")
    private String msg;

    @ApiModelProperty(value = "年月")
    @TableField("YM")
    private Integer ym;

    @Override
    public Serializable pkVal() {
        return this.triggersLogId;
    }
}
